﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Twi.DataAccess.OutInterface
{
    /// <summary>
    /// 存在性判断接口（一般是根据字段及其值去查询判断）
    /// </summary>
    public interface IExistField
    {
        /// <summary>
        /// 字段重复性判断
        /// </summary>
        /// <param name="tableName">表名称（如：TUsers）</param>
        /// <param name="fieldName">字段名称：（如：FName）</param>
        /// <param name="fieldValue">字段值</param>
        /// <returns>是否重复</returns>
        bool ExistField(string tableName, string fieldName, string fieldValue);

        /// <summary>
        /// 字段重复性判断(用于编辑)
        /// </summary>
        /// <param name="tableName">表名称（如：TUsers）</param>
        /// <param name="fieldName">字段名称：（如：FName）</param>
        /// <param name="fieldValue">字段值</param>
        /// <param name="id">编辑记录的ID</param>
        /// <param name="idField">ID字段名（默认为FID）</param>
        /// <returns>是否重复</returns>
        bool ExistField(string tableName, string fieldName, string fieldValue, string id, string idField = "FID");
    }
}
